package org.easy.sensitiveword;


import com.github.houbb.sensitive.word.api.IWordReplace;
import com.github.houbb.sensitive.word.api.IWordResultHandler;
import com.github.houbb.sensitive.word.core.SensitiveWordHelper;

import java.util.List;

/**
 * 通用方法封装工具类
 */
public class SensitiveWordTemplate {


    public boolean contains(String target) {
        return SensitiveWordHelper.contains(target);
    }

    public List<String> findAll(String target) {
        return SensitiveWordHelper.findAll(target);
    }

    public String findFirst(String target) {
        return SensitiveWordHelper.findFirst(target);
    }

    public String replace(String target) {
        return SensitiveWordHelper.replace(target);
    }

    public String replace(String target, char replaceChar) {
        return SensitiveWordHelper.replace(target, replaceChar);
    }

    public String replace(String target, IWordReplace replace) {
        return SensitiveWordHelper.replace(target, replace);
    }

    public <R> List<R> findAll(String target, IWordResultHandler<R> handler) {
        return SensitiveWordHelper.findAll(target, handler);
    }

    public <R> R findFirst(String target, IWordResultHandler<R> handler) {
        return SensitiveWordHelper.findFirst(target, handler);
    }


}